<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2020/7/23
  Time: 10:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>入党考察</title>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8 ? MYOA_CHARSET : htmlspecialchars($HTML_PAGE_CHARSET))?>" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="/lib/layui/layui/css/layui.css?20190817.1">
    <link rel="stylesheet" href="/lib/layui/layui/css/common.css">
    <link rel="stylesheet" href="/lib/layui/layui/css/eleTree.css">
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
    <script src="/lib/layui/layui/layui.js"></script>
    <script src="/lib/jquery.form.min.js"></script>
    <script src="/lib/layui/layui/js/baseCode/base.js?v=2019080918:09" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="/lib/layui/layui/global.js"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <style>
        /*table{*/
        /*    width: 65%;*/
        /*    margin: 0 auto;*/
        /*    margin-bottom: 20px;*/
        /*}*/
        td{
            /*border: 1px solid #999;*/
            padding: 6px 0;
            /*text-align: center;*/
            height: 40px;
        }
        .fromTr>.fromTd1{
            width: 10%;
        }
        .fromTr>.fromTd2{
            width: 20%;
        }
        .fromTd2{
            padding: 0;
        }
        .fromTrinp{
            width: 94%;
            height: 77%;
            border: none;
            padding: 0 10px;
        }
        input,textarea{
            border: none;
            padding-left: 10px;
        }
        input[name="file"]{
            width: 30%;
        }
        .layui-input, .layui-select, .layui-textarea {
            height: 35px;
        }
        .font_style{
             font-family: Microsoft yahei,Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif;
         }
        table{
            border-collapse:separate!important;
        }
        .layui-form-radio {
            line-height: 20px;
            padding-right: 10px;
            cursor: pointer;
            font-size: 0;
        }
        .layui-btn {
            height: 35px;
            /*background-color: #3691DA;*/
            margin-top: -32px;
        }
        .layui-disabled, .layui-disabled:hover {
            color: #708090!important;
        }
        .mindReport{
            /*width: 120px;*/
            display:inline-block;
            border-radius:5px;
            background-color: #dcdcdc;
            /*height: 40px;*/
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            width: 230px;
            line-height: 40px;
        }
    </style>
</head>
<body class="bodycolor font_style">
<table border="0" width="90%" cellspacing="0" cellpadding="3" class="small">
    <tr>
        <td class="Big" style="padding: 19px 0;"><img align="absMiddle" src="/img/commonTheme/${sessionScope.InterfaceModel}/infofind11.png" style="margin-left: 35px;margin-bottom: 2px;"><span class="big3" style="font-family: 微软雅黑;font-size: 22px;margin-left: 10px;">入党考察</span></td>
    </tr>
</table>
<hr style="background-color:#9E9E9E;height: 1px;width:100%;border: none; margin-top: 0px;"/>
<div class="content">
    <form class="layui-form" action="" lay-filter="example">
        <table class="layui-table"  style="margin: 0 auto;margin-top: 20px;width: 82%;">
            <tbody>
            <tr class="fromTr" style="height: 50px;">
                <td colspan="4" style="font-size: 18px; background-color: #009688; text-align: center; color: white">入党考察</td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd1">姓名</td>
                <td class="fromTd2"><input class="fromTrinp layui-disabled"  readonly name="username" type="text"></td>
                <td class="fromTd1">性别</td>
                <td class="fromTd2 ">
<%--                    <input type="radio" disabled="disabled" name="sex" value="0" title="男">--%>
<%--                    <input type="radio" disabled="disabled" name="sex" value="1" title="女">--%>
                    <input class="fromTrinp layui-disabled" name="sex" type="text">
                </td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd1">出生日期</td>
                <td class="fromTd2"><input class="fromTrinp layui-disabled"  name="nativity" type="text"></td>
                <td class="fromTd1">发展阶段</td>
                <td class="fromTd2">
                    <select class="fromTrinp" disabled="disabled" name="development"  type="text">
                        <option value="0">申请阶段</option>
                        <option value="1">申请阶段</option>
                        <option value="2">入党积极分子</option>
                        <option value="3" >发展对象</option>
                        <option value="4" >预备党员未接收</option>
                        <option value="5">已接收预备党员</option>
                        <option value="6">党员</option>
                    </select>
                </td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd1">民族</td>
                <td class="fromTd2"><input class="fromTrinp layui-disabled" name="minority" type="text"></td>
                <td class="fromTd1">职务</td>
                <td class="fromTd2"><input class="fromTrinp layui-disabled" name="functionar" type="text"></td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd1">单位（部门）</td>
                <td class="fromTd2"><input class="fromTrinp layui-disabled" name="unit" type="text"></td>
                <td class="fromTd1">所属党支部</td>
                <td class="fromTd2"><input class="fromTrinp layui-disabled" name="pertain" type="text"></td>
            </tr>
            <tr class="fromTr">
                <td colspan="4" style="font-size: 18px; color: #0c8587">积极分子阶段思想汇报</td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd1" rowspan="4">入党积极分子思想汇报进度</td>
                <td class="fromTd2" colspan="3">
                    <span class="mindReport">入党积极分子第一次思想汇报</span>
                    <button type="button" class="layui-btn layui-btn-disabled applyOne" disabled style="margin-left: 88px;">申请</button></td>
                </td>

            </tr>
            <tr class="fromTr">
                <td class="fromTd2" colspan="3">
                    <span class="mindReport">入党积极分子第二次思想汇报</span>
                    <button type="button" class="layui-btn layui-btn-disabled applyTwo" style="margin-left: 88px">申请</button>
                </td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd2" colspan="3">
                    <span class="mindReport">入党积极分子第三次思想汇报</span>
                    <button type="button" class="layui-btn layui-btn-disabled applyThree" style="margin-left: 88px">申请</button>
                </td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd2" colspan="3">
                    <span class="mindReport">入党积极分子第四次思想汇报</span>
                    <button type="button" class="layui-btn layui-btn-disabled applyFour" style="margin-left: 88px">申请</button>
                </td>
            </tr>
            <tr class="fromTr">
                <td colspan="4" style="font-size: 18px; color: #0c8587">预备党员阶段思想汇报</td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd1" rowspan="4">预备党员考察培养进度</td>
                <td class="fromTd2" colspan="3">
                    <span class="mindReport">预备党员考察培养第一次思想汇报</span>
                    <button type="button" class="layui-btn layui-btn-disabled applyDown" id="applyDownOne" style="margin-left: 88px">申请</button></td>
                </td>

            </tr>
            <tr class="fromTr">
                <td class="fromTd2" colspan="3">
                    <span class="mindReport">预备党员考察培养第二次思想汇报</span>
                    <button type="button" class="layui-btn layui-btn-disabled applyDown" id="applyDownTwo" style="margin-left: 88px">申请</button>
                </td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd2" colspan="3">
                    <span class="mindReport">预备党员考察培养第三次思想汇报</span>
                    <button type="button" class="layui-btn layui-btn-disabled applyDown" id="applyDownThree" style="margin-left: 88px">申请</button>
                </td>
            </tr>
            <tr class="fromTr">
                <td class="fromTd2" colspan="3">
                    <span class="mindReport">预备党员考察培养第四次思想汇报</span>
                    <button type="button" class="layui-btn layui-btn-disabled applyDown" id="applyDownFour" style="margin-left: 88px">申请</button>
                </td>
            </tr>
<%--            <tr>--%>
<%--                <td  colspan="4" style="text-align: center">--%>
<%--                    <button type="button" class="layui-btn apply" style="display: none">申请</button>--%>
<%--                </td>--%>
<%--            </tr>--%>

            </tbody>
        </table>
    </form>
</div>
</body>
</html>
<script>
    layui.use(['upload','form','table','laydate'], function() {
        var upload = layui.upload
        ,form = layui.form
        ,table = layui.table
        ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });

        $.ajax({
            type:'get',
            url:'/partyMember/findPartyMember',
            dataType: 'json',
            success: function (res) {
                //console.log(res.object)
                var data=res.object
                var userId = data.userId;
                var phase = data.developPhase;
                var sex = "";
                if (data.sex == 0) {
                    sex = '男';
                } else {
                    sex = '女';
                }
                //input框赋值
                form.val('example', {
                     "username": data.userName
                    ,"development": data.developPhase //发展阶段
                    ,"sex": sex
                    ,"nativity": data.birthday  //出生日期
                    ,"minority": data.familyName //民族
                    ,"functionar": data.postName//职务
                    ,"unit": data.deptName //单位（部门）
                    ,"pertain": data.parentPedtName //所属党支部
                });
                if(data.userName == ''){
                    layer.alert('您还未申请入党', {
                        icon: 5,
                        title: "提示"
                    });
                }
                //申请跳转
                function applyTurn() {
                    $.ajax({
                        type:'get',
                        url:'/partyMember/fourReport',
                        dataType: 'json',
                        data:{
                            userId:userId,
                            phase:phase
                        },
                        success:function(res){
                            if(res.flag == true){
                                $.popWindow('/workflow/work/workform?opflag=1&flowId='+res.object.flowId+'&type=new&flowStep=1&prcsId=1&runId='+res.object.runId);
                                // window.location.herf = 'workflow/work/workform?opflag=1&flowId="'+170+'"&type=new&flowStep=1&prcsId=1&runId="'+106+')'
                            }else{
                                layer.msg(res.msg);
                            }
                        }
                    });
                }
                if(data.developPhase == '2'){
                    if(data.nodeStatus =="2"){
                        $('.applyOne').removeClass("layui-btn-disabled").attr("disabled",false);
                        $(".applyOne").click(function(){
                            applyTurn();
                        })
                    } else if(data.nodeStatus =="3"){
                        $('.applyTwo').removeClass("layui-btn-disabled").attr("disabled",false);
                        $(".applyTwo").click(function(){
applyTurn();                        })
                    }else if (data.nodeStatus =="4"){
                        $('.applyThree').removeClass("layui-btn-disabled").attr("disabled",false);
                        $(".applyThree").click(function(){
                            applyTurn();
                        })
                    }else if(data.nodeStatus =="5"){
                        $('.applyFour').removeClass("layui-btn-disabled").attr("disabled",false);
                        $(".applyFour").click(function(){
                            applyTurn();
                        })
                    }

                }
                if(data.developPhase == '5'){
                    if(data.nodeStatus =="2"){
                        $('#applyDownOne').removeClass("layui-btn-disabled").attr("disabled",false);
                        $("#applyDownOne").click(function(){
                            applyTurn();
                        })
                    }else if(data.nodeStatus =="3"){
                        $('#applyDownTwo').removeClass("layui-btn-disabled").attr("disabled",false);
                        $("#applyDownTwo").click(function(){
                            applyTurn();
                        })
                    }else if(data.nodeStatus =="4"){
                        $('#applyDownThree').removeClass("layui-btn-disabled").attr("disabled",false);
                        $("#applyDownThree").click(function(){
                            applyTurn();
                        })
                    }else if(data.nodeStatus =="5"){
                        $('#applyDownFour').removeClass("layui-btn-disabled").attr("disabled",false);
                        $("#applyDownFour").click(function(){
                            applyTurn();
                        })
                    }
                }
            }
        })

        //指定允许上传的文件类型
        // upload.render({
        //     elem: '#test20'
        //     ,url: '/upload?module=workflow' //改成您自己的上传接口
        //     ,accept: 'file' //普通文件
        //     ,done: function(res){
        //         var data = res.obj;
        //         var nameFile = data[0].attachName;
        //         //console.log(nameFile);
        //         $(".unchoose").text(nameFile);
        //         layer.msg('上传成功');
        //
        //     }
        // });

    })
    function runWorkListPage() {
        location.reload();
    }
</script>

